﻿using famails.App_Code.source.common;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace famails.Tracking
{
    public partial class inbounce : System.Web.UI.Page
    {
        static log4net.ILog logs_info = log4net.LogManager.GetLogger("InfoRollingLogFileAppender");
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //string _event = Request.Params["event"];
                //string messageId = Request.Params["message-id"];
                //string message_headers = Request.Params["message-headers"];
                //logs_traching.Info("event:" + _event + " header:" + message_headers);
                //if (_event + "" != "" && messageId + "" != "")
                //{
                //    TrackingUtils.TrackingItem(_event, messageId, Request.Params["domain"] + "", Request.Params["recipient"] + "");
                //}
                NameValueCollection param = Request.Params;
                if (param.Count == 0) return;
                for (int i = 0; i < param.Count;i++ )
                {
                    logs_info.Info(param.GetKey(i));
                    logs_info.Info(param.GetValues(i));

                }


                string from = Request.Params["sender"];
                string recipient = Request.Params["recipient"];
                string subject = Request.Params["subject"];
                string body_plain = Request.Params["body-plain"];
                HttpFileCollection files = Request.Files;



                common.Common.logs("from:"+from, null, common.Common.logType.info);
                common.Common.logs("recipient:"+recipient, null, common.Common.logType.info);
                common.Common.logs("subject:"+subject, null, common.Common.logType.info);
                common.Common.logs("body_plain:"+body_plain, null, common.Common.logType.info);
            }
        }
    }
}